package com.streambolics.worseminton.servlet;

import com.streambolics.mail.EmailTextBuilder;
import com.streambolics.std.HtmlBuilder;
import com.streambolics.worseminton.data.Invitation;

public class InvitationMailHandler extends InvitationHandler
{

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    protected void formatBodyAsSimpleDesktopHtml (HtmlBuilder aBuilder, Invitation aResponseObject) throws Exception
    {
        aBuilder.openDiv ("body");
        aBuilder.openElement ("<h1>");
        aBuilder.addText ("This is your invitation e-mail for " + aResponseObject.getEvent ().getDescription ());
        aBuilder.closeElement ("</h1>");
        aBuilder.openForm ("/go/Invitation");
        aBuilder.addHidden ("ID", aResponseObject.getIdAsString ());
        aResponseObject.generateEmail (new EmailTextBuilder (aBuilder, new StringBuilder ()), false);
        aBuilder.closeForm ();
        aBuilder.closeDiv ();
    }
}
